package com.example.utils;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class JsonResult<T> {
    private Integer code;
    private String msg;
    private T data;

    public static JsonResult success(){
        return new JsonResult(200,"ok",null);
    }
    public static <T> JsonResult success(T data){
        return new JsonResult(200,"ok",data);
    }
    public static JsonResult defaultError(){
        return new JsonResult(500,"请求异常",null);
    }
}